package cn.com.infostrategy.ui.mdata.formatcomp;

import java.util.Stack;

import org.nfunk.jep.ParseException;
import org.nfunk.jep.function.PostfixMathCommand;

import cn.com.infostrategy.ui.mdata.BillFormatPanel;
import cn.com.infostrategy.ui.report.chart.BillChartPanel;

public class GetBillChartPanel extends PostfixMathCommand {

	private BillFormatPanel formatpanel = null; //

	public GetBillChartPanel(BillFormatPanel _billcellpanel) {
		this.formatpanel = _billcellpanel; //
		numberOfParameters = 5; //
	}

	public void run(Stack inStack) throws ParseException {
		Object param_1 = inStack.pop(); //types[]
		Object param_2 = inStack.pop(); //months[]
		Object param_3 = inStack.pop(); //vaues
		Object param_4 = inStack.pop(); //months
		Object param_5 = inStack.pop(); //title

		String str_title = (String) param_5;
		String str_xlabel = (String) param_4;
		String str_ylabel = (String) param_3;

		String[] str_xs = ((String) param_1).split(",");
		String[] str_ys = ((String) param_2).split(",");

		BillChartPanel chartPanel = new BillChartPanel(str_title, str_xlabel, str_ylabel, str_xs, str_ys); //

		String _returnkey = "billchart_" + formatpanel.getCompentSeq(); //
		formatpanel.getPanelMap().put(_returnkey, chartPanel); ////
		inStack.push(_returnkey); //
		//System.out.println(_returnkey + "=getList(\"" + templetCode + "\")"); //
	}
}
